class Person:
    def __init__(self, name, age, **kwargs):
        super().__init__(**kwargs)
        self.name = name
        self.age = age
        print(f"Person {name} 初始化")

class Student(Person):
    def __init__(self, student_id,  **kwargs):
        super().__init__( **kwargs)
        self.student_id = student_id
        print(f"学生 {self.name} (学号:{student_id}) 初始化")

class Teacher(Person):
    def __init__(self, subject,  **kwargs):
        super().__init__(**kwargs)
        self.subject = subject
        print(f"老师 {self.name} (科目:{subject}) 初始化")

# 多重继承
class TeachingAssistant(Student, Teacher):
    def __init__(self, **kwargs):
        # 按照MRO顺序调用父类初始化
        super().__init__(**kwargs)
        # super().__init__(name=name, age=age, student_id=student_id, subject=subject)
        # super().__init__(name, age, student_id)    # 调用super 一直报错
        # 注意：这里不能再用super()调用Teacher的__init__，因为super()遵循MRO顺序
        # 如果需要调用Teacher的__init__，需要显式调用
        # Teacher.__init__( self, name, age, subject)
        # super().__init__(name, age, student_id)
        print(f"助教 {self.name} 初始化完成")

# 创建实例
# ta = TeachingAssistant("张三",  22, student_id = "S12345", subject = "计算机科学")
ta = TeachingAssistant(name="张三", age=22, student_id="S12345", subject="计算机科学")
# 查看MRO
print(TeachingAssistant.__mro__)